#pragma once

#include <QList>
#include <QColor>
#include <QPainter>
#include <QWidget>

#include "QCurve.h"

class QPlot: public QWidget
{
    Q_OBJECT

private:
    QList<QCurve> curveList;
    double yMin, yMax;
    double xSpace, ySpace;

public:
    QPlot(QWidget *parent = 0);

    void addPoint(QPointF point, int curveCount = 0);
    void setPen(QPen pen, int curveCount = 0);
    void calcMinMax(void);
    QPointF calcZeroPoint(void);
    QPointF calcRectPoint(void);

    void addCurve(void);
    void removeCurve(void);
    int getCurveNum(void);

protected:
    void paintEvent(QPaintEvent *event);
    void drawGrid(QPainter &painter);

signals:

};
